package lab02.test30;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/11/12.
 */
public class Test {
    public static void main(String[] args) {
        float[] score;float sum=0;
        int k;
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入要计算平均成绩的人数：");
        int c=scanner.nextInt();
        score = new float[c];
        for (k=0;k<c;k++) {
            System.out.println("请输入第" + (k + 1) + "个人的成绩：");
            score[k] = scanner.nextFloat();
            sum=sum+score[k];
        }
        System.out.println("平均成绩为："+sum/c);
    }
    }

